<template>
	<view class="choose_depa-content-box">
		<view class="header-box">
			<view :class="isEdit?'w80 search-box':'search-box'">
				<image class="search-img" src="../../static/icon_search.png" mode="aspectFill"></image>
				<input :focus="isEdit" @focus="searchFocus" @blur="searchBlur" class="search-input" type="text" placeholder="请输入科室名称" />
			</view>
			<view class="cancel" v-if="isEdit" @click="cancelSearchClick">
				取消
			</view>
		</view>
		<view class="item-box">
			<view class="item-left-box">
				<view class="item-left" v-for="item in 15">
					皮肤科
				</view>
			</view>
			<view class="item-right-box">
				<view class="item-right" v-for="item in 15">
					皮肤科111
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isEdit: false, // 是否在输入
				depaData: [
					{
						name: "内科",
						child: [{
							name: "普通内科"
						}]
					}
				]
			};
		},
		methods: {
			searchBlur(){
				// this.isEdit = false;
			},
			searchFocus(){
				this.isEdit = true;
			},
			cancelSearchClick(){
				this.isEdit = false;
			}
		}
	}
</script>

<style lang="less" scoped>
	view{
		box-sizing: border-box;
	}
	.choose_depa-content-box{
		min-height: 100%;
		background-color: #FFFFFF;
		padding-top: 100rpx;
		overflow: hidden;
		.header-box{
			width: 100%;
			position: fixed;
			top: 0rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}
		.cancel{
			margin-left: 10rpx;
			color: #0098f2;
		}
		
		.search-box{
			width: 90%;
			height: 80rpx;
			background-color: #eaeefb;
			display: flex;
			align-items: center;
			border-radius: 40rpx;
			padding-left: 10rpx;
			padding-right: 20rpx;
			.search-img{
				width: 50rpx;
				height: 50rpx;
			}
			.search-input{
				flex: 1;
				margin-left: 10rpx;
				font-size: 26rpx;
				color: #323233;
			}
		}
		.w80{
			width: 80%;
		}
		.item-box{
			position: absolute;
			top: 100rpx;
			bottom: 0rpx;
			left: 0rpx;
			right: 0rpx;
			overflow-y: hidden;
			background-color: #FFFFFF;
			display: flex;
			.item-left-box{
				width: 200rpx;
				height: 100%;
				overflow-y:scroll;
				border-right: solid 1rpx #eaeefb;
				.item-left{
					width: 100%;
					height: 120rpx;
					display: flex;
					justify-content: center;
					align-items: center;
				}
			}
			.item-right-box{
				height: 100%;
				flex: 1;
				padding: 0rpx 30rpx;
				overflow-y:scroll;
				
				.item-right{
					width: 100%;
					height: 80rpx;
					background-color: #eaeefb;
					display: flex;
					justify-content: center;
					align-items: center;
					margin-top: 15rpx;
				}
			}
		}
	}
</style>
